home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10494 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: grimsel.zurich.ibm.com!usenet
  2. From: wgk@zurich.ibm.com (Keith Whittingham)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: dynamic_cast costs?
  5. Date: 8 Mar 1996 08:05:09 GMT
  6. Organization: IBM Research, ZRH
  7. Message-ID: <4hopnl$oif@grimsel.zurich.ibm.com>
  8. References: <4h79hl$7lc@news.halcyon.com> <4h7prn$666@fsgi01.fnal.gov>
  9. Reply-To: wgk@zurich.ibm.com
  10. NNTP-Posting-Host: pine.zurich.ibm.com
  11. X-Newsreader: IBM NewsReader/2 v1.00
  12.  
  13. In <4h7prn$666@fsgi01.fnal.gov>, b91926@fsgi01.fnal.gov (David Sachs) writes:
  14. >normanb@halcyon.com (Norm Bryar) writes:
  15. >
  16. >....
  17. >>    Lastly, in MSVC4, I erroneously tried getting from B1 to B2 without an
  18. >>intermediate dynamic_cast to D in the following hierarchy:  
  19. >
  20. >>        class D : public B1, public B2.  
  21. >
  22. >>It threw an access violation and then a "MS C++ Exception."  I thought
  23. >>it was just supposed to return NULL if it couldn't make the cast.
  24. >
  25. >I assume you mean that you tried to cast a B1* to a B2*, where the
  26. >object pointed to is actually a D, and B1 has at least one virtual
  27. >function.
  28. >
  29. >In that case, you have encountered a compilaer limitation or bug. BCC
  30. >handles such a dynamic cast properly. Such a dynamic cast is in accordance
  31. >with the draft C++ standard.
  32. >-- 
  33. >***** Listen Americans, the IRS is your taxer,  the IRS is one. *****
  34. >David Sachs - Fermilab, HPPC MS369 - P. O. Box 500 - Batavia, IL 60510
  35. >Voice: 1 708 840 3942      Deparment Fax: 1 708 840 3785
  36.  
  37.